package com.bwie.system.controller;

import com.bwie.common.domain.YouXiang;
import com.bwie.common.result.Result;
import com.bwie.system.service.YouXiangService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("youXiang")
@CrossOrigin
public class YouXiangController {



    @Autowired
    YouXiangService youXiangService;

    /**
     * 查询全部
     * @param youXiang
     * @return
     */
    @PostMapping("xianglist")
    public Result xianglist(@RequestBody YouXiang youXiang){
     PageInfo<YouXiang> youXiangPageInfo= youXiangService.xianglist(youXiang);
     return Result.success(youXiangPageInfo);
    }

    /**
     * 查询待开始
     * @param youXiang
     * @return
     */
    @PostMapping("xianglistsss")
    public Result xianglistsss(@RequestBody YouXiang youXiang){
        PageInfo<YouXiang> youXiangPageInfos= youXiangService.xianglistsss(youXiang);
        return Result.success(youXiangPageInfos);
    }

    /**
     * 查询进行中
     * @param youXiang
     * @return
     */
    @PostMapping("xianglistsses")
    public Result xianglistsses(@RequestBody YouXiang youXiang){
        PageInfo<YouXiang> youXiangPageInfoes= youXiangService.xianglistsses(youXiang);
        return Result.success(youXiangPageInfoes);
    }


    /**
     *查询已结束
     * @param youXiang
     * @return
     */

    @PostMapping("xianglistx")
    public Result xianglistx(@RequestBody YouXiang youXiang){
        PageInfo<YouXiang> youXiangPageInfox= youXiangService.xianglistx(youXiang);
        return Result.success(youXiangPageInfox);
    }




}
